home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 001-025 / disk_003 / xlisp / xlftab.c < prev    next >
C/C++ Source or Header  |  1992-05-06  |  6KB  |  205 lines

  1. /* xlftab.c - xlisp function table */
  2.  
  3. #include "xlisp.h"
  4.  
  5. /* external functions */
  6. extern NODE
  7.     *xeval(),*xapply(),*xfuncall(),*xquote(),*xbquote(),
  8.     *xset(),*xsetq(),*xsetf(),*xdefun(),*xdefmacro(),
  9.     *xgensym(),*xmakesymbol(),*xintern(),
  10.     *xsymname(),*xsymvalue(),*xsymplist(),*xget(),*xremprop(),
  11.     *xcar(),*xcaar(),*xcadr(),*xcdr(),*xcdar(),*xcddr(),
  12.     *xcons(),*xlist(),*xappend(),*xreverse(),*xlast(),*xnth(),*xnthcdr(),
  13.     *xmember(),*xassoc(),*xsubst(),*xsublis(),*xremove(),*xlength(),
  14.     *xmapc(),*xmapcar(),*xmapl(),*xmaplist(),
  15.     *xrplca(),*xrplcd(),*xnconc(),*xdelete(),
  16.     *xatom(),*xsymbolp(),*xnumberp(),*xboundp(),*xnull(),*xlistp(),*xconsp(),
  17.     *xeq(),*xeql(),*xequal(),
  18.     *xcond(),*xand(),*xor(),*xlet(),*xletstar(),*xif(),
  19.     *xprog(),*xprogstar(),*xprog1(),*xprog2(),*xprogn(),*xgo(),*xreturn(),
  20.     *xcatch(),*xthrow(),
  21.     *xerror(),*xcerror(),*xbreak(),*xerrset(),*xbaktrace(),*xevalhook(),
  22.     *xdo(),*xdostar(),*xdolist(),*xdotimes(),
  23.     *xadd(),*xsub(),*xmul(),*xdiv(),*xrem(),*xmin(),*xmax(),*xabs(),
  24.     *xadd1(),*xsub1(),*xbitand(),*xbitior(),*xbitxor(),*xbitnot(),
  25.     *xminusp(),*xzerop(),*xplusp(),*xevenp(),*xoddp(),
  26.     *xlss(),*xleq(),*xequ(),*xneq(),*xgeq(),*xgtr(),
  27.     *xstrlen(),*xstrcat(),*xsubstr(),*xascii(),*xchr(),*xatoi(),*xitoa(),
  28.     *xread(),*xprint(),*xprin1(),*xprinc(),*xterpri(),
  29.     *xflatsize(),*xflatc(),*xexplode(),*xexplc(),*ximplode(),*xmaknam(),
  30.     *xopeni(),*xopeno(),*xclose(),*xrdchar(),*xpkchar(),*xwrchar(),*xreadline(),
  31.     *xload(),*xgc(),*xexpand(),*xalloc(),*xmem(),*xtype(),*xexit();
  32.  
  33. /* the function table */
  34. struct fdef ftab[] = {
  35.  
  36.     /* evaluator functions */
  37. {    "eval",        SUBR,    xeval        },
  38. {    "apply",    SUBR,    xapply        },
  39. {    "funcall",    SUBR,    xfuncall    },
  40. {    "quote",    FSUBR,    xquote        },
  41. {    "function",    FSUBR,    xquote        },
  42. {    "backquote",    FSUBR,    xbquote        },
  43.  
  44.     /* symbol functions */
  45. {    "set",        SUBR,    xset        },
  46. {    "setq",        FSUBR,    xsetq        },
  47. {    "setf",        FSUBR,    xsetf        },
  48. {    "defun",    FSUBR,    xdefun        },
  49. {    "defmacro",    FSUBR,    xdefmacro    },
  50. {    "gensym",    SUBR,    xgensym        },
  51. {    "make-symbol",    SUBR,    xmakesymbol    },
  52. {    "intern",    SUBR,    xintern        },
  53. {    "symbol-name",    SUBR,    xsymname    },
  54. {    "symbol-value",    SUBR,    xsymvalue    },
  55. {    "symbol-plist",    SUBR,    xsymplist    },
  56. {    "get",        SUBR,    xget        },
  57. {    "remprop",    SUBR,    xremprop    },
  58.  
  59.     /* list functions */
  60. {    "car",        SUBR,    xcar        },
  61. {    "caar",        SUBR,    xcaar        },
  62. {    "cadr",        SUBR,    xcadr        },
  63. {    "cdr",        SUBR,    xcdr        },
  64. {    "cdar",        SUBR,    xcdar        },
  65. {    "cddr",        SUBR,    xcddr        },
  66. {    "cons",        SUBR,    xcons        },
  67. {    "list",        SUBR,    xlist        },
  68. {    "append",    SUBR,    xappend        },
  69. {    "reverse",    SUBR,    xreverse    },
  70. {    "last",        SUBR,    xlast        },
  71. {    "nth",        SUBR,    xnth        },
  72. {    "nthcdr",    SUBR,    xnthcdr        },
  73. {    "member",    SUBR,    xmember        },
  74. {    "assoc",    SUBR,    xassoc        },
  75. {    "subst",    SUBR,    xsubst        },
  76. {    "sublis",    SUBR,    xsublis        },
  77. {    "remove",    SUBR,    xremove        },
  78. {    "length",    SUBR,    xlength        },
  79. {    "mapc",        SUBR,    xmapc        },
  80. {    "mapcar",    SUBR,    xmapcar        },
  81. {    "mapl",        SUBR,    xmapl        },
  82. {    "maplist",    SUBR,    xmaplist    },
  83.  
  84.     /* destructive list functions */
  85. {    "rplaca",    SUBR,    xrplca        },
  86. {    "rplacd",    SUBR,    xrplcd        },
  87. {    "nconc",    SUBR,    xnconc        },
  88. {    "delete",    SUBR,    xdelete        },
  89.  
  90.     /* predicate functions */
  91. {    "atom",        SUBR,    xatom        },
  92. {    "symbolp",    SUBR,    xsymbolp    },
  93. {    "numberp",    SUBR,    xnumberp    },
  94. {    "boundp",    SUBR,    xboundp        },
  95. {    "null",        SUBR,    xnull        },
  96. {    "not",        SUBR,    xnull        },
  97. {    "listp",    SUBR,    xlistp        },
  98. {    "consp",    SUBR,    xconsp        },
  99. {    "minusp",    SUBR,    xminusp        },
  100. {    "zerop",    SUBR,    xzerop        },
  101. {    "plusp",    SUBR,    xplusp        },
  102. {    "evenp",    SUBR,    xevenp        },
  103. {    "oddp",        SUBR,    xoddp        },
  104. {    "eq",        SUBR,    xeq        },
  105. {    "eql",        SUBR,    xeql        },
  106. {    "equal",    SUBR,    xequal        },
  107.  
  108.     /* control functions */
  109. {    "cond",        FSUBR,    xcond        },
  110. {    "and",        FSUBR,    xand        },
  111. {    "or",        FSUBR,    xor        },
  112. {    "let",        FSUBR,    xlet        },
  113. {    "let*",        FSUBR,    xletstar    },
  114. {    "if",        FSUBR,    xif        },
  115. {    "prog",        FSUBR,    xprog        },
  116. {    "prog*",    FSUBR,    xprogstar    },
  117. {    "prog1",    FSUBR,    xprog1        },
  118. {    "prog2",    FSUBR,    xprog2        },
  119. {    "progn",    FSUBR,    xprogn        },
  120. {    "go",        FSUBR,    xgo        },
  121. {    "return",    SUBR,    xreturn        },
  122. {    "do",        FSUBR,    xdo        },
  123. {    "do*",        FSUBR,    xdostar        },
  124. {    "dolist",    FSUBR,    xdolist        },
  125. {    "dotimes",    FSUBR,    xdotimes    },
  126. {    "catch",    FSUBR,    xcatch        },
  127. {    "throw",    SUBR,    xthrow        },
  128.  
  129.     /* debugging and error handling functions */
  130. {    "error",    SUBR,    xerror        },
  131. {    "cerror",    SUBR,    xcerror        },
  132. {    "break",    SUBR,    xbreak        },
  133. {    "errset",    FSUBR,    xerrset        },
  134. {    "baktrace",    SUBR,    xbaktrace    },
  135. {    "evalhook",    SUBR,    xevalhook    },
  136.  
  137.     /* arithmetic functions */
  138. {    "+",        SUBR,    xadd        },
  139. {    "-",        SUBR,    xsub        },
  140. {    "*",        SUBR,    xmul        },
  141. {    "/",        SUBR,    xdiv        },
  142. {    "1+",        SUBR,    xadd1        },
  143. {    "1-",        SUBR,    xsub1        },
  144. {    "rem",        SUBR,    xrem        },
  145. {    "min",        SUBR,    xmin        },
  146. {    "max",        SUBR,    xmax        },
  147. {    "abs",        SUBR,    xabs        },
  148.  
  149.     /* bitwise logical functions */
  150. {    "bit-and",    SUBR,    xbitand        },
  151. {    "bit-ior",    SUBR,    xbitior        },
  152. {    "bit-xor",    SUBR,    xbitxor        },
  153. {    "bit-not",    SUBR,    xbitnot        },
  154.  
  155.     /* numeric comparison functions */
  156. {    "<",        SUBR,    xlss        },
  157. {    "<=",        SUBR,    xleq        },
  158. {    "=",        SUBR,    xequ        },
  159. {    "/=",        SUBR,    xneq        },
  160. {    ">=",        SUBR,    xgeq        },
  161. {    ">",        SUBR,    xgtr        },
  162.  
  163.     /* string functions */
  164. {    "strlen",    SUBR,    xstrlen        },
  165. {    "strcat",    SUBR,    xstrcat        },
  166. {    "substr",    SUBR,    xsubstr        },
  167. {    "ascii",    SUBR,    xascii        },
  168. {    "chr",        SUBR,    xchr        },
  169. {    "atoi",        SUBR,    xatoi        },
  170. {    "itoa",        SUBR,    xitoa        },
  171.  
  172.     /* I/O functions */
  173. {    "read",        SUBR,    xread        },
  174. {    "print",    SUBR,    xprint        },
  175. {    "prin1",    SUBR,    xprin1        },
  176. {    "princ",    SUBR,    xprinc        },
  177. {    "terpri",    SUBR,    xterpri        },
  178. {    "flatsize",    SUBR,    xflatsize    },
  179. {    "flatc",    SUBR,    xflatc        },
  180. {    "explode",    SUBR,    xexplode    },
  181. {    "explodec",    SUBR,    xexplc        },
  182. {    "implode",    SUBR,    ximplode    },
  183. {    "maknam",    SUBR,    xmaknam        },
  184.  
  185.     /* file I/O functions */
  186. {    "openi",    SUBR,    xopeni        },
  187. {    "openo",    SUBR,    xopeno        },
  188. {    "close",    SUBR,    xclose        },
  189. {    "read-char",    SUBR,    xrdchar        },
  190. {    "peek-char",    SUBR,    xpkchar        },
  191. {    "write-char",    SUBR,    xwrchar        },
  192. {    "readline",    SUBR,    xreadline    },
  193.  
  194.     /* system functions */
  195. {    "load",        SUBR,    xload        },
  196. {    "gc",        SUBR,    xgc        },
  197. {    "expand",    SUBR,    xexpand        },
  198. {    "alloc",    SUBR,    xalloc        },
  199. {    "mem",        SUBR,    xmem        },
  200. {    "type",        SUBR,    xtype        },
  201. {    "exit",        SUBR,    xexit        },
  202.  
  203. {    0                    }
  204. };
  205.